// 全局配置

import { Agreement, UserType } from "@/types/api"
import { get, post } from "../utils/request"
/**
 * 获取支付方式列表
 * @param params 
 * @returns 
 */
export const GetAgreementList = (params:Agreement)=>{
    return post("/cdwl-merchant/inner/agreement/list",params)
}
/**
 * 保存支付方式
 * @param params 
 * @returns 
 */
export const SaveAgreement = (params:Agreement)=>{
    return post("/cdwl-merchant/inner/agreement/save",params)
}
/**
 * 编辑支付方式
 * @param params 
 * @returns 
 */
export const UpdateAgreement = (params:Agreement)=>{
    return post("/cdwl-merchant/inner/agreement/update",params)
}
/**
 * 获取支付方式详情
 * @param id 
 * @returns 
 */
export const GetAgreementInfo = (id:string)=>{
    return get(`/cdwl-merchant/inner/agreement/info/${id}`)
}
/**
 * 删除支付方式
 * @param params 
 * @returns 
 */
export const DeleteAgreement = (params:Array<string>)=>{
    return post("/cdwl-merchant/inner/agreement/deleteBatch",
        params
    )
}
/**
 * 根据协议类型获取协议详情
 * @param type 
 * @returns 
 */
export const GetAgreementInfoByType =(type:string)=>{
    return get(`/cdwl-merchant/inner/agreement/getByType/${type}`)
}
/**
 * 获取用户类型列表
 * @param type 
 * @returns 
 */
export const getUserTypeList =(params: UserType)=>{
    return post(`/cdwl-merchant/inner/userType/list`, params)
}
/**
 * 用户类型 - 新增
 * @param type 
 * @returns 
 */
export const addUserType =(params: UserType)=>{
    return post(`/cdwl-merchant/inner/userType/save`, params)
}
/**
 * 用户类型 - 编辑
 * @param type 
 * @returns 
 */
export const editUserType =(params: UserType)=>{
    return post(`/cdwl-merchant/inner/userType/update`, params)
}
/**
 * 用户类型 - 批量删除
 * @param type 
 * @returns 
 */
export const deleteUserType =(params: Array<string>)=>{
    return post(`/cdwl-merchant/inner/userType/deleteBatch`, params)
}
/**
 * 用户类型 - 详情
 * @param type 
 * @returns 
 */
export const getUserType =(id: string)=>{
    return get(`/cdwl-merchant/inner/userType/info/${id}`)
}